Skip to content

fix(wrangler): fix spurious config diffs for binding arrays in different order#12135

Merged
edmundhung merged 2 commits intomainfrom
edmundhung/fix-config-diff-binding-order
Feb 11, 2026
Merged

fix(wrangler): fix spurious config diffs for binding arrays in different order#12135
edmundhung merged 2 commits intomainfrom
edmundhung/fix-config-diff-binding-order

Conversation

@edmundhung
Copy link
Member

@edmundhung edmundhung commented Jan 26, 2026

Fixes #12074.

The config diff handles object keys in different order just fine, the root issue here is arrays being compared positionally. So if the remote API returns kv_namespaces with the same bindings in a different order, the diff shows them as removed and re-added.

This sorts remote binding arrays to match the local config's order before comparing. The list of binding types is type-checked exhaustively against CfWorkerInit["bindings"], so new binding types will cause a compile error if not handled.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix

A picture of a cute animal (not mandatory, but encouraged)


Open with Devin

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2026

🦋 Changeset detected

Latest commit: 10954a1

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 26, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@12135

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@12135

miniflare

npm i https://pkg.pr.new/miniflare@12135

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@12135

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@12135

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@12135

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@12135

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@12135

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@12135

wrangler

npm i https://pkg.pr.new/wrangler@12135

commit: 10954a1

@edmundhung edmundhung force-pushed the edmundhung/fix-config-diff-binding-order branch from a63c605 to b874b2d Compare February 6, 2026 12:33
@claude
Copy link
Contributor

claude bot commented Feb 6, 2026

Claude finished @edmundhung's task —— View job


Changeset Review

✅ All changesets look good

The changeset .changeset/fix-config-diff-binding-order.md passes all validation criteria:

  1. Version Type: ✅ Patch is appropriate for a bug fix
  2. Changelog Quality: ✅ Clear description with context about the issue and solution
  3. Markdown Headers: ✅ No h1/h2/h3 headers present
  4. Analytics: ✅ No new analytics collection
  5. Experimental Features: ✅ Not applicable

@edmundhung edmundhung force-pushed the edmundhung/fix-config-diff-binding-order branch from b874b2d to c74aeb0 Compare February 6, 2026 15:26
@edmundhung edmundhung force-pushed the edmundhung/fix-config-diff-binding-order branch from c74aeb0 to ef991bf Compare February 6, 2026 15:31
@edmundhung edmundhung marked this pull request as ready for review February 6, 2026 15:56
@edmundhung edmundhung requested a review from a team as a code owner February 6, 2026 15:56
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Thanks @edmundhung! 🫶 😄

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Feb 11, 2026
@edmundhung edmundhung merged commit cc5ac22 into main Feb 11, 2026
46 of 47 checks passed
@edmundhung edmundhung deleted the edmundhung/fix-config-diff-binding-order branch February 11, 2026 12:19
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Feb 11, 2026
@edmundhung edmundhung mentioned this pull request Feb 11, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Incorrect diff when local configuration differs from remote configuration

3 participants